import java.util.ArrayList;
import java.util.Stack;

public class Solution4 {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     *
     * @param input int整型一维数组
     * @param k int整型
     * @return int整型ArrayList
     */
    public ArrayList<Integer> GetLeastNumbers_Solution (int[] input, int k) {
        // write code here
        ArrayList<Integer> arrayList = new ArrayList<>();
        Stack<Integer> stack = new Stack<>();
        Stack<Integer> stack2 = new Stack<>();
        int count = 0;
        for(int i = 0;i < input.length;i++) {

            if(stack.empty()) {
                stack.push(input[i]);
            } else {
                if(input[i] <= k) {
                    stack.push(input[i]);
                    count ++;
                }
            }
        }
        return arrayList;
    }

}
